import Vue from "vue/dist/vue.esm";

function vueRender({ loading }) {
  return new Vue({
    template: `
      <h4 v-if="loading" id="loading">Loading...</h4>
    `,
    data() {
      return {
        loading
      };
    }
  }).$mount("#loading");
}

let app = null;

export default function render({ loading }) {
  if (!app) {
    app = vueRender({ loading });
  } else {
    app.loading = loading;
  }
}
